package com.zhixiang.xaec.action.system;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.zhixiang.core.command.QueryFilter;
import com.zhixiang.core.web.action.BaseAction;
import com.zhixiang.xaec.entity.system.SystemLog;
import com.zhixiang.xaec.service.system.SystemLogService;
@Controller
@Scope("prototype")
public class SystemLogAction extends BaseAction
{
    
    
    private static final long serialVersionUID = 5164034405880990198L;
    @Resource(type=SystemLogService.class)
    SystemLogService systemLogService;
    //条件查询返回json
    public String list(){  
        QueryFilter localQueryFilter = new QueryFilter(getRequest());
        List<SystemLog>localList = this.systemLogService.getAll(localQueryFilter);         
        setSuccess(true);
        setTotalCounts(localQueryFilter.getPagingBean().getTotalItems());
        setResult(localList);
        return SUCCESS;
    }
    //通用删除
    public String delete(){
        String[] ids = getRequest().getParameterValues("ids");
        systemLogService.delete(ids);
        return SUCCESS;
    }
    //通过ID获得实体Json
    public String get(){
        String id = getRequest().getParameter("id");        
        setResult(systemLogService.get(Long.valueOf(id)));
        return SUCCESS;
    }

}
